<cfoutput>
	<div class="row">
		<div class="span12">
			<div class="center" style="margin:1.5em;">
				#dspBackButton(
					text="Back To Admin",
					onClick="location='#URLFor(controller='main',action='admin')#';",
					title="Go Back to the Admin Page"
				)#
			</div>
			<form id="parentsForm" class="validateForm" style="border:0px none!important;">
				#dspAddButton(
					text="Add Parent", 
					action = "#URLFor(route="updateForm", key="0", model="parent", subModel="student")#",
					title = "Add New Parent"
				)#
				<table id="parentsTable" class="table table-striped">
					<thead>
						<tr class="headerRow">
							<cfloop list="First Name,Last Name,Address,City,State,Zip,E-mail" index="column">
								<th>#column#</th>
							</cfloop>
							<th>&nbsp;</th>
						</tr>
					</thead>
					<tbody>
						</cfoutput>
						<cfoutput query="parents" group="id">
							<tr class="bodyRow1">
								<cfloop list="first_name,last_name,address,state,city,zip,email" index="column">
									<td>#parents[column][parents.currentRow]#</td>
								</cfloop>
								<td nowrap="true">
									#dspEditButton(
										action = "#URLFor(route="updateForm", key="#parents.id#", model="parent", subModel="student")#",
										title = "Edit Parent"
									)#
									#dspDeleteButton(
										onClick="location='#URLFor(route="deleteItem", key="#parents.id#", model="parent")#';",
										title = "Delete Parent"
									)#
								</td>
							</tr>
							<cfoutput>
								<cfif Val(parents.studentID)>
									<tr class="subRow0">
										<th class="transparent" colspan="2"></th>
										<th class="right" style="vertical-align:middle;">Students:</th>
										<td class="left" valign="middle" style="vertical-align:middle;" colspan="5">
											<span style="display:inline-block;margin-top:3px;">#parents.studentfirst_name# #parents.studentlast_name#</span>
											<cfset deleteURL = URLFor(
													route="deleteSubItem",
													key="#parents.parentStudentID#",
													model="parent",
													subModel="student"
												)>
											#dspDeleteSubItemButton(
												style= "margin-left: 5px;",
												onClick = "location='#deleteURL#';",
												title="Remove Student Association"
											)#
										</td>
									</tr>
								</cfif>
							</cfoutput>
						</cfoutput>
						<cfoutput>
					</tbody>
				</table>

				<div id="parentsRow" class="hidden">
					<input type="text" name="first_name" class="addItem input-small" value="" index="0"/>
					<input type="text" name="last_name" class="addItem input-small" value="" index="1"/>
					<input type="text" name="address" class="addItem input-small" value="" index="3"/>
					<input type="text" name="state" class="addItem input-small" value="" index="4"/>
					<input type="text" name="city" class="addItem input-small" value="" index="5"/>
					<input type="text" name="zip" class="addItem input-small" value="" index="6"/>
					<input type="text" name="email" class="addItem input-small" value="" index="7"/>
					#dspDeleteButton(class="addItem", onClick="$(this).parent().parent().remove();", index="8")#
				</div>
			</form>
		</div>
	</div>

	<!--- Dialog --->
	<div id="modal" class="modal hide fade in">
		<!--- Header --->
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal">&times;</button>
			<h3></h3>
		</div>
		<!--- Body --->
		<div class="modal-body">
			<p></p>
		</div>
		<!--- Footer --->
		<div class="modal-footer">
			<a href="##" class="btn" data-dismiss="modal">Close</a>
			<a href="##" class="btn btn-primary saveButton">Save changes</a>
		</div>
	</div>
</cfoutput>
